#include "widget.h"
#include "ui_widget.h"

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
    ui->pushButtonDay->setToolTip("白天模式");
    ui->pushButtonNight->setToolTip("夜间模式");
    ui->pushButtonDay->setToolTipDuration(5000);
    ui->pushButtonNight->setToolTipDuration(5000);
}

Widget::~Widget()
{
    delete ui;
}


void Widget::on_pushButtonDay_clicked()
{
    //设置窗口样式
    this->setStyleSheet("background-color:#f3f3f3");
    //设置输入框样式
    ui->textEdit->setStyleSheet("background-color:#fff;color:#000;");
    //设置按钮样式
    ui->pushButtonDay->setStyleSheet("color:#000");
    ui->pushButtonNight->setStyleSheet("color:#000");
}

void Widget::on_pushButtonNight_clicked()
{
    //设置窗口样式
    this->setStyleSheet("background-color:#333");
    //设置输入框样式
    ui->textEdit->setStyleSheet("background-color:rgb(0,0,0)");
    ui->textEdit->setStyleSheet("color:rgb(240,240,240)");
    //设置按钮样式
    ui->pushButtonDay->setStyleSheet("color:rgb(240,240,240)");
    ui->pushButtonNight->setStyleSheet("color:rgb(240,240,240)");
}
